export const state = {
  socketState: "Disconnected",
};
export const mutations = {
  websocket_state(state, status) {
    state.socketState = status;
  },
};
export const actions = {
  getSocketDataAction({ dispatch }, data) {
    console.log("收到服务器消息->>>>在此分发消息到其他组件", data);
    let { Event, Info } = JSON.parse(data);
    dispatch(Event, Info);
    // switch (Event) {
    //     case 'SiteStateChange':
    //         console.log('分发到SiteStateChange')
    //         dispatch('SiteStateChange', Info);
    //         break;
    //     case 'DeviceStateChange':
    //         dispatch('DeviceStateChange', Info);
    //         break;
    //     case 'AccessoryStateChange':

    //         break;
    // }
    // dispatch('user/changeName', data)
  },
};
export const getters = {};
